import { MockMethod } from 'vite-plugin-mock';
import { resultPageSuccess, resultSuccess } from '../_util';
enum Api {
  inventorylist = '/inventory/inventorylist',
  abnomalList = '/inventory/abnomalList',
  departmentlist = '/inventory/departmentlist',
  assetlist = '/inventory/assetlist',
}

const prefix = '/jeecgboot';
export default [
  {
    url: prefix + Api.inventorylist,
    timeout: 1000,
    method: 'get',
    response: ({ query }) => {
      const { page = 1, pageSize = 20 } = query;
      return resultPageSuccess(page, pageSize, [
        { name: '正常', value: '12' },
        { name: '盘亏', value: '6' },
        { name: '盘盈', value: '3' },
        { name: '位置差异', value: '8' },
      ]);
    },
  },
  {
    url: prefix + Api.abnomalList,
    timeout: 1000,
    method: 'get',
    response: ({ query }) => {
      const { page = 1, pageSize = 20 } = query;
      return resultPageSuccess(page, pageSize, [
        { month: '一月', value: '12' },
        { month: '二月', value: '6' },
        { month: '三月', value: '3' },
        { month: '四月', value: '8' },
      ]);
    },
  },
  {
    url: prefix + Api.departmentlist,
    timeout: 1000,
    method: 'get',
    response: ({ query }) => {
      const { page = 1, pageSize = 20 } = query;
      return resultPageSuccess(page, pageSize, [
        { title: '资产管理部门', value: '6' },
        { title: '设备管理部门', value: '8' },
      ]);
    },
  },
  {
    url: prefix + Api.assetlist,
    timeout: 1000,
    method: 'get',
    response: ({ query }) => {
      const { page = 1, pageSize = 20 } = query;
      return resultPageSuccess(page, pageSize, [
        { title: '电脑', value: '3' },
        { title: '桌子', value: '6' },
        { title: '椅子', value: '4' },
      ]);
    },
  },
] as MockMethod[];
